/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_Local", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbLocal.findAll", query = "SELECT t FROM TbLocal t"),
    @NamedQuery(name = "TbLocal.findByLID", query = "SELECT t FROM TbLocal t WHERE t.lID = :lID"),
    @NamedQuery(name = "TbLocal.findByLName", query = "SELECT t FROM TbLocal t WHERE t.lName = :lName")})
public class TbLocal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "l_ID", nullable = false)
    private Integer lID;
    @Column(name = "l_Name", length = 50)
    private String lName;
    @Lob
    @Column(name = "l_Description", length = 2147483647)
    private String lDescription;
    @OneToMany(mappedBy = "lid")
    private List<TbHotel> tbHotelList;

    public TbLocal() {
    }

    public TbLocal(Integer lID) {
        this.lID = lID;
    }

    public Integer getLID() {
        return lID;
    }

    public void setLID(Integer lID) {
        this.lID = lID;
    }

    public String getLName() {
        return lName;
    }

    public void setLName(String lName) {
        this.lName = lName;
    }

    public String getLDescription() {
        return lDescription;
    }

    public void setLDescription(String lDescription) {
        this.lDescription = lDescription;
    }

    public List<TbHotel> getTbHotelList() {
        return tbHotelList;
    }

    public void setTbHotelList(List<TbHotel> tbHotelList) {
        this.tbHotelList = tbHotelList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (lID != null ? lID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbLocal)) {
            return false;
        }
        TbLocal other = (TbLocal) object;
        if ((this.lID == null && other.lID != null) || (this.lID != null && !this.lID.equals(other.lID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbLocal[lID=" + lID + "]";
    }

}
